﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IPumpService" in both code and config file together.
[ServiceContract]
public interface IPumpService
{
    /// <summary>
    /// Oprettelse af pumpestation
    /// Der indtastes data om den nye pumpestation – bl.a. netværksadresse, IP-adresse og portnummer samt oplysninger om lav, normal, høj og kritisk vandstand.
    /// </summary>
    /// <param name="ipAdress"></param>
    /// <param name="port"></param>
    /// <param name="waterLevel"></param>
    /// <param name="status"></param>
    /// <returns></returns>
    [OperationContract]
    bool AddStation(string ipAdress, int port, double waterLevel, int status);

    /// <summary>
    /// Oprettelse af pumpe i pumpestation
    /// Der indtastes data om pumpen – f.eks. om dens pumpekapacitet i m3 pr. time
    /// </summary>
    /// <param name="id"></param>
    /// <param name="capacity">pump capacity for pump</param>
    /// <param name="status"></param>
    /// <param name="stationId"></param>
    [OperationContract]
    bool AddPump(double capacity, int status, int stationId);

    /// <summary>
    /// Ændring af pumpestationens data
    /// Hvis det bliver nødvendigt at ændre på data om en specifik pumpestation
    /// </summary>
    [OperationContract]
    bool EditStation(int id, string ipAdress, int port, double waterLevel, int status);

    /// <summary>
    /// Ændring af pumpes data
    /// Hvis det bliver nødvendigt at ændre på data om en specifik pumpe i en specifik pumpestation.
    /// Change pump data
    /// </summary>
    [OperationContract]
    bool EditPump(double capacity, int status, int pumpId);

    /// <summary>
    /// Sletning af pumpe
    /// </summary>
    [OperationContract]
    bool RemovePump(int id);

    /// <summary>
    /// Delete pumps by station id
    /// </summary>
    [OperationContract]
    bool RemovePumpsByStationId(int stationId);

    /// <summary>
    /// Sletning af pumpestation
    /// </summary>
    [OperationContract]
    bool RemoveStation(int id);

    /// <summary>
    /// Hent oplysning om aktuel vandstand
    /// Der sendes anmodning til specifik pumpestation om at rapportere aktuelle vandstand
    /// Request current water level for specific pumpstation
    /// </summary>
    [OperationContract]
    List<Pump> RequestCurrentStatus(int stationId);

    [OperationContract]
    bool StartStation(int id);

    /// <summary>
    /// Start pumpe
    /// Der sendes anmodning til specifik pumpestation om at starte specifik pumpe.
    /// Request specific pumpstation to start specific pump
    /// </summary>
    [OperationContract]
    bool StartPump(int id);

    /// <summary>
    /// Stop pumpe
    /// Der sendes anmodning til specifik pumpestation om at stoppe specifik pumpe.
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    [OperationContract]
    bool StopStation(int id);

    /// <summary>
    /// Request specific pumpstation to stop specific pump
    /// </summary>
    [OperationContract]
    bool StopPump(int id);


    /// <summary>
    /// Hent oplysninger om alle pumpestationer
    /// Alle pumpestationer i listen anmodes om efter tur at rapportere om aktuelle vandstand
    /// </summary>
    [OperationContract]
    List<Station> RequestCurrentStatusForAll();

    [OperationContract]
    Station FindStation(int stationId);

    [OperationContract]
    Pump FindPump(int pumpId);

    #region Log
    [OperationContract]
    bool AddLog(int stationId, double waterIn, double waterLevel, DateTime date);
    [OperationContract]
    bool UpdateLog(int stationId, double waterOut, double waterLevel, DateTime date);
    [OperationContract]
    List<WaterLevelLog> RequestLog(Station station);

    #endregion
}